const { defineConfig } = require("@vue/cli-service");
// console.log(process.env)
let baseURL=process.env.VUE_APP_BASEURL
console.log("当前的环境是："+process.env.VUE_APP_ENV)
let env=process.env.NODE_ENV;
const path = require('path');
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
outputDir:env==="test"?"testDist":"dist",

  devServer: {
    proxy: {
      "/api": {
        target: baseURL,
        pathRewrite: {
          "^/api": ""
        }
      }
    }
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set('%', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('components', resolve('src/components'))
      .set('layout', resolve('src/layout'))
      .set('base', resolve('src/base'))
      .set('static', resolve('src/static'))
  }
});
  

